import Vue from 'vue'
import Vuex from 'vuex'
import getlink from '../api/getlink.js'
import  Loading from "./Loading"
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // isLoading: false,
    arr:[]
  },
  mutations: {
    // mChangeIsLoading(state, payload) {
    //   state.isLoading = payload;
    // },
    uparr(state,payload){
      // 8把请求来的数据修改state
      state.arr=payload.arrdata
      // console.log(state.arr);
    }
  },
  actions: {
    getaxios(context,payload){
      // console.log(context)

      getlink(payload.url).then((ok)=>{
        // console.log(ok.data.recuperate)
        context.commit("uparr",{arrdata:ok.data.recuperate})
      })
    }
  },
  modules: {
    Loading
}
})
